package cn.com.godliu.gatewaydemo1.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class business {

    @Value("${privatecyversion}")
    private String version;

    @GetMapping(value = "/hello")
    public String sayHello(String name) {
        return "bs1:Hello," + name;
    }

    @GetMapping(value = "/slow")
    public String slow() {
        try {
            Thread.sleep(3000L);
            return "success slow";
        } catch (Exception e) {
            return "error slow";
        }
    }

    @GetMapping("/pversion")
    public String pversion() {
        return version;
    }


}
